<template>
  <div class="Showcase2">
    <div class="shadow-box">
      <div class="shadow-box-top">
       
        <img
          class="shadow-box-top-left"
          :src="publicUrls + 'free/style7/Showcase2dy1.webp'"
          alt=""
        />
        <div
          class="shadow-box-top-center"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style7/Showcase2dy2.webp'})`,
          }"
        ></div>
        <img
          class="shadow-box-top-right"
          :src="publicUrls + 'free/style7/Showcase2dy3.webp'"
          alt=""
        />
      </div>
      <div class="shadow-box-center">
        <div
          class="shadow-box-center-left"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style7/Showcase2dy4.webp'})`,
          }"
        ></div>
        <div
          class="shadow-box-center-center"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style7/Showcase2dy5.webp'})`,
          }"
        ></div>
        <div
          class="shadow-box-center-right"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style7/Showcase2dy6.webp'})`,
          }"
        ></div>
      </div>
      <div class="shadow-box-bottom">
        <img
          class="shadow-box-bottom-left"
          :src="publicUrls + 'free/style7/Showcase2dy7.webp'"
          alt=""
        />
        <div
          class="shadow-box-bottom-center"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style7/Showcase2dy8.webp'})`,
          }"
        ></div>
        <img
          class="shadow-box-bottom-right"
          :src="publicUrls + 'free/style7/Showcase2dy9.webp'"
          alt=""
        />
      </div>
      <!-- <img class="shadow-left" :src="publicUrls + 'free/style7/Showcase2dy1.webp'" alt="" /> -->
    </div>
    <div class="Showcase2-top">
       <div
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style7/Showcase2dy10.webp'})`,
            left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 1.7638)}rem`,
          }"
          class="ex-item"
          v-for="(item, index) in props.list"
          :key="index"
        >
          <p class="name-box">
            {{ item.name }}
          </p>
        </div>
      <img
        class="Showcase2-top-left"
        :src="publicUrls + 'free/style7/Showcase2bg1.webp'"
        alt=""
      />
      <div
        class="Showcase2-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase2bg2.webp'})`,
        }"
      ></div>
      <img
        class="Showcase2-top-right"
        :src="publicUrls + 'free/style7/Showcase2bg3.webp'"
        alt=""
      />
    </div>
    <div class="Showcase2-center">
      <div
        class="Showcase2-center-left"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase2bg4.webp'})`,
        }"
      ></div>
      <div
        class="Showcase2-center-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase2bg5.webp'})`,
        }"
      ></div>
      <div
        class="Showcase2-center-right"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase2bg6.webp'})`,
        }"
      ></div>
    </div>
    <div class="Showcase2-bottom">
      <img
        class="Showcase2-bottom-left"
        :src="publicUrls + 'free/style7/Showcase2bg7.webp'"
        alt=""
      />
      <div
        class="Showcase2-bottom-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase2bg8.webp'})`,
        }"
      ></div>
      <img
        class="Showcase2-bottom-right"
        :src="publicUrls + 'free/style7/Showcase2bg9.webp'"
        alt=""
      />
    </div>
    <!-- Showcase2Topleft -->
  </div>
</template>    

<script lang="ts">
export default defineComponent({
  name: 'style2',
});
</script>
  
<script setup lang="ts">
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x + 0.3;
};
</script>  

<style scoped lang="less">
.Showcase2 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 302px;
  min-width: 340px;
  -webkit-box-reflect: none;
}
.Showcase2-top {
  position: relative;
  display: flex;
  width: 100%; 
  height: 136px;
}
.Showcase2-top-left {
  width: 120px;
  height: 136px;
}
.Showcase2-top-center {
  flex: 1;
  height: 136px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase2-top-right {
  width: 120px;
  height: 136px;
}
.ex-item { 
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 68px;
  width: 254px;
  height: 51px;
  z-index: 30;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.name-box {
  display: block;
  width: 216px; 
  height: 32px;  
 font-family: SourceMedium;
  font-size: 18px; 
  color: rgba(51, 51, 51, 1);
  line-height: 32px;  
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.Showcase2-center {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100% - 252px);
}
.Showcase2-center-left {
  width: 120px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.Showcase2-center-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase2-center-right {
  width: 120px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.Showcase2-bottom {
  position: relative;
  display: flex;
  width: 100%;
  height: 116px;
}
.Showcase2-bottom-left {
  width: 120px;
  height: 116px;
}
.Showcase2-bottom-center {
  flex: 1;
  height: 116px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase2-bottom-right {
  width: 120px;
  height: 116px;
}
.shadow-box {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% - 24px);
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}
.shadow-box-top {
  position: relative;
  display: flex;
  width: 100%;
  height: 116px;
}
.shadow-box-top-left {
  width: 120px;
  height: 116px;
}
.shadow-box-top-center {
  flex: 1;
  height: 116px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.shadow-box-top-right {
  width: 120px;
  height: 116px;
}
.shadow-box-center {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100% - 252px);
}
.shadow-box-center-left {
  width: 120px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.shadow-box-center-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.shadow-box-center-right {
  width: 120px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.shadow-box-bottom {
  position: relative;
  display: flex;
  width: 100%;
  height: 136px;
}
.shadow-box-bottom-left {
  width: 120px;
  height: 136px;
}
.shadow-box-bottom-center {
  flex: 1;
  height: 136px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.shadow-box-bottom-right {
  width: 120px;
  height: 136px;
}
</style>